IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].GetDeliverableStatusesForFinance') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].GetDeliverableStatusesForFinance 
GO
-- =======================================================================
-- Procedure Name: dbo.GetDeliverableStatusesForFinance
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 03/12/09
--
-- Description: Returns list of Deliverable Statuses for Subcontract Reports
--
-- Parameters:  None
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.GetDeliverableStatusesForFinance()
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 03/12/09    RM		 Created based on the GetDeliverableTypes stored
--
-- =======================================================================

CREATE PROCEDURE [dbo].[GetDeliverableStatusesForFinance]
AS
BEGIN
     /*  Returned Fields for Dropdown
     --------------------------------
     DELSTAT             VARCHAR             
     DELSTATID           VARCHAR
     */

     -- Initial Settings
     SET NOCOUNT ON
     
     -- Declare Local Variables
     DECLARE   @Error            INT,
               @RowCount         INT

     -- Result Query    
     SELECT 'ALL'   AS DELSTAT,
               0    AS DELSTATID,
            'All' AS DELSTATDESC
     UNION
     SELECT 'FSRAssigned',
               1,
            'FSR Report Assigned'
     UNION
     SELECT 'FSRCompleted',
               2,
            'FSR Report Completed'
     UNION
     SELECT 'FSRDue',
               3,
            'FSR Report Due'
     UNION
     SELECT 'FSROutToDept',
               4,
            'FSR Report Out to Dept'
     UNION
     SELECT 'Other',
               5,
            'Other'
     UNION
     SELECT 'Pending',
               6,
            'Pending'     
     ORDER BY DELSTATID              

     SELECT @Error=@@ERROR,@RowCount=@@ROWCOUNT
     IF @Error!=0
          RETURN -1

     -- Return Success
     RETURN 0     
END
GO

GRANT EXECUTE ON dbo.GetDeliverableStatusesForFinance TO InsightReport,Insight
GO

